<script>
	import { checkNeedLogin, checkIsLogin, goToLogin, requestInterceptor, responseInterceptor } from '@/utils/auth.js'
	
	export default {
		onLaunch: function() {
			console.log('App Launch');
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		},
		// 页面跳转拦截
		onPageNotFound: function() {
			uni.redirectTo({
				url: '/pages/index/index'
			})
		},
		// 页面跳转拦截
		onPageShow: function(options) {
			const url = options.path
			if (checkNeedLogin(url) && !checkIsLogin()) {
				goToLogin()
				return false
			}
		}
	};
</script>

<style>
	/*每个页面公共css */ 
	page {
		background-color: #f8f8f8;
		font-size: 28rpx;
		color: #333;
	}
</style>
